import {
  Entity,
  Column,
  PrimaryGeneratedColumn,
  CreateDateColumn,
  Generated,
  UpdateDateColumn,
  OneToMany,
} from 'typeorm'

@Entity()
export class Topic {
  @PrimaryGeneratedColumn('uuid') //自动递增的uuid
  id: string
  @Column({ type: 'varchar', length: 16 })
  name: string
  @Column({
    type: 'varchar',
    comment: '头图',
    length: 255,
    default: '1677749097502.jpg',
  })
  avatar: string

  @CreateDateColumn({ type: 'timestamp', update: false, comment: '创建时间' })
  create_time: Date
  @UpdateDateColumn({ type: 'timestamp', update: true, comment: '更新时间' })
  update_time: Date
}
